package 设计模式.q_访问者模式;

import java.util.Arrays;

/**
 * @author caihe
 * @date 2023/3/21 16:46
 */
public class Test {

    public static void main(String[] args) {
        
        Sergeant sergeant = new Sergeant();
        Sergeant sergeant1 = new Sergeant();
        Sergeant[] a = new Sergeant[]{sergeant, sergeant1};
        
        Commander commander = new Commander(a);
        
        commander.accept(new CommanderVisitor());
        commander.accept(new SergeantVisitor());
    }
    
}
